﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using LogisticDatabase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LogisticDatabase;
using LogisticDatabase.Models;

namespace LogisticDatabase.Tests
{
    [TestClass()]
    public class CityDataAccessTests
    {
        [TestMethod()]
        public void listAllTest()
        {
            Assert.Fail();
        }

        [TestMethod()]
        public void editTest()
        {
            CityDataAccess cityDataAccess = new CityDataAccess();

            List<City> cities = cityDataAccess.listAll();

            if (cities != null)
            {
                City city = cities[0];
                city.Name = "Ujnev3";
                cityDataAccess.edit(city);

                city = cityDataAccess.getCityById(city.Id);

                Assert.AreEqual("Ujnev3", city.Name);

            }
            else
            {

                Assert.Fail();
            }
        }

        [TestMethod()]
        public void addTest()
        {
            Assert.Fail();
        }

        [TestMethod()]
        public void deleteTest()
        {
            //Arrange
            //Act
            //Assert
            //Assert.IsNotNull();
        }
    }
}